import http from "../api/http";
// import request from './request'
let resquest = "/seeyon";
export default {
  //   /*
  //   * 实列
  //   * */
  //   //用户登录
  //   userlogin(params){
  //     return http.post(`${resquest}/auth/login`,params)
  //   },
  // //  用户权限查看
  //   getpermissions(params){
  //     return http.get(`${resquest}/auth/getUserInfo`)
  //   },
  //
  //
  // //  删除菜单
  //   delmenu(params){
  //     return http.delete(`${resquest}/system/menu/${params}`)
  //   },
  // //  修改菜单
  //   putmenu(params){
  //     return http.put(`${resquest}/system/menu/edit`,params)
  //   },

  /**
   * 新建/修改过滤规则
   * @Date: 2022-06-08 10:21:04
   * @Author: tangxiangping
   * @param {*} params { id: string, subject: string, senderId: string, senderName: string}
   * @return {*} Promise
   */
  putfilter(params) {
    return http.post(`${resquest}/rest/emailFolder/updateFolderRule`, params);
  },

  /**
   * 将过滤规则应用到历史邮件
   * @Date: 2022-06-08 11:46:09
   * @Author: tangxiangping
   * @param {*} id 自定义文件夹id
   * @return {*} Promise
   */
  putfilterToHistory(id) {
    return http.get(`${resquest}/rest/emailFolder/historyEmailClassify/${id}`);
  },

  //jian start
  //提交新建文件夹
  submitNewFolder(obj) {
    return http.post(`${resquest}/rest/emailFolder/sendFolder`, obj);
  },
  //修改自定义菜单名称
  changeFolderName(obj) {
    return http.post(`${resquest}/rest/emailFolder/updateFolder`, obj);
  },
  //删除自定义菜单
  delFolder(obj) {
    return http.post(`${resquest}/rest/emailFolder/deleteFolder`, obj);
  },
  //移动邮件到自定义菜单
  moveFolder(arr) {
    return http.post(`${resquest}/rest/emailFolder/sendEmailGotoFolder`, arr);
  },
  //搜索查询人员
  searchQueryStaff(obj) {
    return http.post(`${resquest}/rest/newemail/seaechName`, obj);
  },
  //jy end

  // 获取图片连接
  getImgurl(obj) {
    return http.post(`${resquest}/rest/newemail/preview`, obj);
  },
  // 获取审核连接
  getShurl(id) {
    return http.post(`${resquest}/rest/newemail/flowMsg`, {
      summaryId: id,
    });
  },
  // 查询邮件是否撤回
  getShurlis(id) {
    return http.post(`${resquest}/rest/newemail/revokeMsg`, {
      affairIds: id,
    });
  },

  //  邮件详情
  emliaInfo(id) {
    return http.get(`${resquest}/rest/newemail/mailContent/${id}`);
  },
  //  邮箱数量
  emlianum() {
    return http.get(`${resquest}/rest/newemail/inBoxMailNum`);
  },
  //  邮件列表
  emlist(obj) {
    return http.post(`${resquest}/rest/newemail/MailList`, obj);
  },
  //  删除邮件列表
  delemali(obj) {
    return http.post(`${resquest}/rest/newemail/deleteMail`, obj);
  },
  //  操作邮件
  operemali(obj) {
    return http.post(`${resquest}/rest/newemail/updateAffairIsHandle`, obj);
  },
  //  加密箱验证
  encryption(obj) {
    return http.post(`${resquest}/rest/newemail/encryption`, obj);
  },
  //  加密箱新增密码
  updateOrAddPwd(obj) {
    return http.post(`${resquest}/rest/newemail/updateOrAddPwd`, obj);
  },
  //  获取分组列表
  getMailGroupType() {
    return http.post(`${resquest}/rest/newemail/MailGroupType`);
  },
  //  查看回执
  getcheckStatus(obj) {
    return http.post(`${resquest}/rest/newemail/checkStatus`, obj);
  },
  //  撤销
  emalirecovery(obj) {
    return http.post(`${resquest}/rest/newemail/rescindMail`, obj);
  },
  //  撤销校验
  judgeRescindMail(obj) {
    return http.post(`${resquest}/rest/newemail/judgeRescindMail`, obj);
  },
  //  撤销校验
  recoverydel(obj) {
    return http.post(`${resquest}/rest/newemail/recovery`, obj);
  },

  /*
   * 发件
   * */

  //  获取密级
  getSecretList(obj) {
    return http.post(`${resquest}/rest/newemail/getSecretList`, obj);
  },
  //  获取密级
  isSecret(obj) {
    return http.post(`${resquest}/rest/newemail/isSecret`, obj);
  },
  //  获取签名
  getmailSignature() {
    return http.post(`${resquest}/rest/newemail/mailSignature`);
  },
  //  转发
  forwordMail(obj) {
    return http.post(`${resquest}/rest/newemail/forwordMail`, obj);
  },

  //  检验文件密级
  MailFileSecret(obj) {
    return http.post(`${resquest}/rest/newemail/MailFileSecret`, obj);
  },
  //  编辑获取内容
  internalCompile(obj) {
    return http.post(`${resquest}/rest/newemail/internalCompile`, obj);
  },
  //  编辑获取内容
  replyMailinfo(obj) {
    return http.post(`${resquest}/rest/newemail/reply`, obj);
  },
  //  编辑获取内容
  allreplyMailinfo(obj) {
    return http.post(`${resquest}/rest/newemail/allReply`, obj);
  },

  /**
   * 邮件审批
   * @desc: 根据选中密级对 收件人、抄送人 进行验证
   * @param {object} params: 请求参数
   * @param {string} params.secretTypeId: 密级id
   * @param {Array<string>} params.copyReceivers: 抄送人
   * @param {Array<string>} params.receivers: 收件人  
   * @return {Promise<{ code:number, data:boolean, message:string }>} 验证结果
   */
  // 屏蔽邮件审批功能
  // emailApproval(params) {
  //   const url = `${resquest}/rest/emailapproval/emailappr`;
  //   return http.post(url, params);
  // },

  //  发送邮件
  sendemail(obj) {
    return http.post(`${resquest}/rest/newemail/sendEmail`, obj);
  },

  MailFileSecretVerify(obj) {
    return http.post(`${resquest}/rest/newemail/MailFileSecretVerify`, obj);
  },

  //  文件上传
  loadflie(obj, onUploadProgress) {
    return http.upload(`${resquest}/rest/attachment`, obj, onUploadProgress);
  },
  /**
   * @function downloadAllFile: 下载全部附件// (核心)通知后端将所有附件进行打包
   */
  downloadAllFile(summaryId) {
    return http.get(`${resquest}/rest/newemail/packFile/${summaryId}`);
  },

  // 校验查看密级
  // MailPersonSecretVerify(obj) {
  //   return http.post(`${resquest}/rest/newemail/MailPersonSecretVerify`, obj);
  // },
  // 下载邮件
  exportEmail(obj) {
    return http.post(`${resquest}/rest/newemail/exportEmail`, obj);
  },
  //获取用户信息
  getuserInfo() {
    return http.get(`${resquest}/rest/newemail/getMemberByDeptApproverRole`);
  },
  //获取角色
  getroleId() {
    return http.get(`${resquest}/rest/newemail/getMemberByDeptApproverRole`);
  },

  /*********************************************************************************** */
  // 取消继续编辑暂存的邮件
  cancelAutosaveApi(firstAutosaveTime, affairId) {
    return http.get(
      `${resquest}/rest/newemail/cancelAutosave?firstAutosaveTime=${firstAutosaveTime}&oldAffairId=${affairId}`
    );
  },

  // 获取组或者部门的成员信息
  getGroupUserInfoApi(id) {
    return http.post(`${resquest}/rest/newemail/getMembersByDeptOrTeam`, {
      id,
    });
  },

  // 获取当前跨网权限
  getKuaWangShowApi() {
    return http.get(`${resquest}/rest/newemail/showKuaWang`);
  },

  allpro(arr) {
    return http.all();
  },
  // 根据选人组件获取人员信息
  getPeopleMsg(obj) {
    return http.post(`${resquest}/rest/newemail/getMemeberList`, obj);
  },
  // 第三方待办菜单  jianyuan
  getNewMenu() {
    return http.get(`${resquest}/rest/cipAppAffiar/cipAppAffiarMenu`);
  },

  // 待办数和未读数接口
  getAffiarNoReadNum(id) {
    return http.get(
      `${resquest}/rest/cipAppAffiar/findMsgNumAndPendingNum/${id}`
    );
  },
  //所有第三方待办数据   分页
  getAllThirdToDo(id, str) {
    return http.get(
      `${resquest}/rest/cipAppAffiar/cipAppPendingList/${id}` + str
    );
  },
  //获取当前菜单应用的已办待办未读已读数据
  getApplicationNumber(id) {
    return http.get(`${resquest}/rest/cipAppAffiar/findNum/${id}`);
  },

  //未读消息数据
  getNotReadList(id, str) {
    return http.get(
      `${resquest}/rest/cipAppMessage/noReadMessageList/${id}` + str
    );
  },
  //已读消息数据
  getReadMessageList(id, str) {
    return http.get(
      `${resquest}/rest/cipAppMessage/readMessageList/${id}` + str
    );
  },

  //待办搜索
  searchInfo(str, id) {
    return http.get(
      `${resquest}/rest/cipAppAffiar/searchCipAppPending/${id}` + str
    );
  },
  //已办搜索
  searchInfoHasPend(str, id) {
    return http.get(
      `${resquest}/rest/cipAppAffiar/cipAppHasPendingList/${id}` + str
    );
  },
  //已读搜索
  messageReadSearchInfo(str, id) {
    return http.get(
      `${resquest}/rest/cipAppMessage/searchReadMessage/${id}` + str
    );
  },

  //未读搜索
  messageNoReadSearchInfo(str, id) {
    return http.get(
      `${resquest}/rest/cipAppMessage/searchNoReadMessage/${id}` + str
    );
  },
  //已办数据
  cipAppHasPending(id, str) {
    return http.get(
      `${resquest}/rest/cipAppAffiar/cipAppHasPendingList/${id}` + str
    );
  },
  // 全部标记已读
  MarkReadAll(id) {
    return http.put(`${resquest}/rest/cipAppMessage/updateAllReadState/${id}`);
  },

  // 选择的标记已读
  selectMarkRead(array) {
    return http.put(`${resquest}/rest/cipAppMessage/updateReadState/${array}`);
  },

  //已办 待办 的删除
  cipAppAffiarHasPendingDel(array) {
    return http.delete(
      `${resquest}/rest/cipAppAffiar/deleteCipAppPending/${array}`
    );
  },
  //已读 未读 的全部清空
  cipAppReadAndNotReadDel(str) {
    return http.delete(
      `${resquest}/rest/cipAppMessage/deleteAllMessage/` + str
    );
  },
  //已读 未读 的清空已选择的
  cipAppSelectDel(array) {
    return http.delete(`${resquest}/rest/cipAppMessage/deleteMessage/${array}`);
  },
};
